package cn.cj.erp.bo.system;

import cn.cj.erp.common.SearchParam;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * 角色与部门对应关系
 *
 * @author chenjian
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysRoleDeptBo extends SearchParam {
    /** 角色ID */
    private Long roleId;

    /** 部门ID */
    private Long deptId;

    public static List<SysRoleDeptBo> newList(Long roleId, List<Long> deptIds) {
        List<SysRoleDeptBo> list = new ArrayList<>();
        for (Long deptId : deptIds) {
            SysRoleDeptBo bo = new SysRoleDeptBo();
            bo.setDeptId(deptId);
            bo.setRoleId(roleId);
            list.add(bo);
        }
        return list;
    }
}
